package com.demo.yang.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.util.WebUtils;

import com.demo.yang.bean.Account;
import com.demo.yang.constant.YangConstant;

public class BaseController {

	
	public static void setAccountToSession(HttpServletRequest request,Account account){
		WebUtils.setSessionAttribute(request, YangConstant.ACCOUNT_IN_SESSION,account) ;
	}
	
	public static Account getAccountFromSession(HttpServletRequest request){
		return (Account)WebUtils.getSessionAttribute(request, YangConstant.ACCOUNT_IN_SESSION);
	}
	
}
